Class AbstractDocumentView

    • Field Detail

      • structureButtonBox

        protected StructureButtons structureButtonBox
        Buttons for Download options in structure view.
      • viewerPresenter

        protected DocumentViewPresenter viewerPresenter
        The ViewerPresenter instance of this DocumentView.
      • zkDownloadMode

        protected boolean zkDownloadMode
        How to handle downloads.
      • maxViewSize

        protected long maxViewSize
        Limit of image size to display.
      • dontAskForDownload

        protected boolean dontAskForDownload
        Whether to ask before downloading.
      • localization

        protected final LocalizationUtil localization
        LocalizationUtil instance.
      • viewerComp

        protected ViewerComponent viewerComp
        Embedded viewer component.
      • viewerId

        protected java.lang.String viewerId
        ID to identify the viewer.
      • mainLayout

        protected org.zkoss.zul.Borderlayout mainLayout
        Main layout component of this DocumentView.
      • multiDocumentList

        protected StructureList<?> multiDocumentList
        Structure view.
      • def

        protected com.saperion.ngc.iform.xml.ViewerType def
        Mask element definition.
      • viewerClass

        protected java.lang.String viewerClass
        Class name of the embedded viewer component.
      • maskRights

        protected int maskRights
        Default mask-rights.
    • Constructor Detail

      • AbstractDocumentView

        public AbstractDocumentView​(java.lang.String documentViewTitle,
                                    java.lang.String documentViewBorder,
                                    java.lang.Boolean closable)
        Constructor with title, border, closable option.
        Parameters:
        documentViewTitle - Title
        documentViewBorder - Border
        closable - Closable
      • AbstractDocumentView

        public AbstractDocumentView()
        Standard Constructor.
    • Method Detail

      • onCreate

        public abstract void onCreate​(org.zkoss.zk.ui.event.Event event)
        Event handler for onCreate event.
        Parameters:
        event - ZK event
      • onDisplayResultItem

        public abstract void onDisplayResultItem​(org.zkoss.zk.ui.event.Event event)
        Display document.
        Specified by:
        onDisplayResultItem in interface DocumentView
        Parameters:
        event - Event
      • init

        protected void init()
        Initializes the viewer classes by setting things like layout, max view size, max document size and so on.
      • isSizeLimitEnabled

        protected boolean isSizeLimitEnabled()
        Tells if the size limit for viewing documents is enabled. Therefore the max view size must be set to an integer value > 0.
        Returns:
        True if the max view size > 0, false else.
      • getNativeRequest

        protected javax.servlet.http.HttpServletRequest getNativeRequest()
        Gets the native request.
        Returns:
        the native request
      • onLogon

        public final void onLogon​(org.zkoss.zk.ui.event.Event event)
        Event handler for logon event. The viewer will be enabled if the logon was successful.
        Specified by:
        onLogon in interface DocumentView
        Parameters:
        event - ZK event
      • disable

        public final void disable()
        Disables the viewer.
        Specified by:
        disable in interface DocumentView
      • enable

        public final void enable()
        Enables the viewer.
        Specified by:
        enable in interface DocumentView
      • reset

        public final void reset()
        Closes the current document.
        Specified by:
        reset in interface DocumentView
      • reset

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

        public void onResetGui​(org.zkoss.zk.ui.event.Event event)
        Handler for reset ui event.
        Specified by:
        onResetGui in interface DocumentView
        Parameters:
        event - ZK event
      • refreshView

        public final void refreshView()
        Refreshes the view with the last opened document.
        Specified by:
        refreshView in interface DocumentView
      • generateRandomViewerId

        protected java.lang.String generateRandomViewerId()
        Generates a random ID used to identify each viewer. This ID is used by VirtualViewer to find it's session in the ContentHandler.
        Returns:
        the generated id
      • fillStructureView

        protected void fillStructureView​(java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> infos,
                                         DocumentId documentId)
        Fills the structure list with available documents to show in the viewer component. Additionally, if documents are available to show, the buttons for download etc. of structure view are enabled or disabled if no documents are available.
        Parameters:
        infos - structure information
        documentId - id of the document
      • getPageListStream

        protected java.io.InputStream getPageListStream​(DocumentId documentId,
                                                        java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentElements)
        Parameters:
        documentId - ID of the document
        documentElements - list of the document's elements
        Returns:
        stream containing the page-list (for ALF viewer)
      • makeViewerBean

        protected void makeViewerBean​(DocumentId documentId,
                                      java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentElements,
                                      boolean currentRevision)
        Creates a new viewer control-bean or updates the existing one.
        Parameters:
        documentId - document id
        documentElements - elements of the document
        currentRevision - whether the current revision of the document should be resolved or not
      • canView

        protected boolean canView​(DocumentId documentId)
        Checks if the user is allowed to display the document.
        Parameters:
        documentId - id of the document
        Returns:
        true if document can be displayed
      • canDownload

        protected boolean canDownload​(DocumentId documentId)
        Checks if the user is allowed to download the document.
        Parameters:
        documentId - id of the current document
        Returns:
        true if document can be downloaded
      • inIfomPopup

        protected boolean inIfomPopup()
        Returns:
        true if this document view is part of an iform-popup.
      • setEnableLoadingMessage

        public 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.
        Specified by:
        setEnableLoadingMessage in interface DocumentView
        Parameters:
        enable - enabled or disabled
        See Also:
        DocumentView.setEnableLoadingMessage(boolean)
      • setStructureButtonsBoxShown

        public void setStructureButtonsBoxShown​(boolean showStructureButtonsBox)
        Description copied from interface: DocumentView
        Set the visibility of the its structure button box and its containingn structure buttons of the structure view.
        Specified by:
        setStructureButtonsBoxShown in interface DocumentView
        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.
      • isStructureButtonsBoxShown

        public boolean isStructureButtonsBoxShown()
        Description copied from interface: DocumentView
        Tells you if the structure buttons of the structure view are shown or not. Default is true.
        Specified by:
        isStructureButtonsBoxShown in interface DocumentView
        Returns:
        True if structure buttons and its surrounding structure button box of structure view are shown, false else.
      • enableStructureButtonsWhen

        protected void enableStructureButtonsWhen​(boolean enable)
        Parameters:
        enable - enable or disabled structure buttons