Package com.saperion.ngc.viewer
Class AbstractDocumentView
- java.lang.Object
-
- org.zkoss.zk.ui.AbstractComponent
-
- org.zkoss.zk.ui.HtmlBasedComponent
-
- org.zkoss.zul.impl.XulElement
-
- org.zkoss.zul.Window
-
- com.saperion.ngc.events.BaseWindow
-
- com.saperion.ngc.viewer.AbstractDocumentView
-
- All Implemented Interfaces:
EventChild,EventChildHandler,LogEventChildHandler,DocumentView,java.io.Serializable,java.lang.Cloneable,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.IdSpace,org.zkoss.zk.ui.sys.ComponentCtrl,org.zkoss.zul.ext.Framable
- Direct Known Subclasses:
DocumentViewImpl,SapDocumentViewImpl
public abstract class AbstractDocumentView extends BaseWindow implements DocumentView
Abstract class that holds common methods for both, the SAP Web Viewer and the document viewer for the web client. User: chg Date: 07.03.12 Time: 16:37- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAbstractDocumentView.AskForDownloadListenerListener for the messagebox shown when a document is too big to be displayed.
-
Field Summary
Fields Modifier and Type Field Description protected com.saperion.ngc.iform.xml.ViewerTypedefMask element definition.protected booleandontAskForDownloadWhether to ask before downloading.protected LocalizationUtillocalizationLocalizationUtil instance.protected org.zkoss.zul.BorderlayoutmainLayoutMain layout component of this DocumentView.protected intmaskRightsDefault mask-rights.protected longmaxViewSizeLimit of image size to display.protected StructureList<?>multiDocumentListStructure view.protected StructureButtonsstructureButtonBoxButtons for Download options in structure view.protected OpenDocumentBeanviewerBeanViewer's control-bean.protected java.lang.StringviewerClassClass name of the embedded viewer component.protected ViewerComponentviewerCompEmbedded viewer component.protected java.lang.StringviewerIdID to identify the viewer.protected DocumentViewPresenterviewerPresenterThe ViewerPresenter instance of this DocumentView.protected booleanzkDownloadModeHow to handle downloads.-
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
-
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
-
Fields inherited from interface com.saperion.ngc.viewer.DocumentView
EDIT_WINDOW_PREFIX, NO_EXTERNAL_WINDOW, POPUP_BEAN_ATTRIBUTE
-
Fields inherited from interface com.saperion.ngc.events.EventChild
ALL_EVENTS, ON_ADD_LINK, ON_ADD_LOOKUP, ON_ADD_TO_FAVORITES, ON_AFTER_QUERY, ON_BUTTON, ON_BUTTON_QUERY, ON_CANCEL, ON_CANCEL_AND, ON_CANCEL_EDIT, ON_CHANGE_DOCUMENT_SECURITY, ON_CHANGE_FOLDER_SECURITY, ON_CLEAR, ON_DELETE_SELECTED, ON_DISPLAY_POPUP, ON_DISPLAY_RESULTITEM, ON_DISPLAY_TEMPORARY_DOCUMENT, ON_DOCUMENT_ADDED, ON_DOCUMENT_CHECK, ON_DOCUMENT_FILING, ON_DOCUMENT_LOCKED, ON_DOCUMENT_PROLONG_RETENTION, ON_DOCUMENT_REDUCE_DISPOSITION, ON_DOCUMENT_RELEASE, ON_DOWNLOAD_RESULTITEM, ON_EDIT_CONTENT, ON_EDIT_FOLDER, ON_EDIT_ITEM, ON_EDIT_ITEM_SELECTED, ON_EDIT_LOOKUP, ON_EDIT_SELECTED, ON_EDIT_STRUCTURE, ON_EXPORT, ON_EXTERNAL_STORAGE_UPLOAD, ON_EXTERNAL_STORAGE_UPLOAD_STATUS, ON_FAST_ACCESS_DRAG_OVER, ON_FIELD_CHANGE, ON_FILE_ACTION, ON_FILE_PREVIEW, ON_FILE_SEARCH, ON_FORM_CREATED, ON_FORM_RENDER_ERROR, ON_FORWARD, ON_IGNORE, ON_INDEX, ON_INDEX_CLEAR, ON_INDEX_RESULTITEM, ON_ITEM_DOUBLECLICK, ON_LAUNCH_WORKFLOW, ON_LOG, ON_LOGON, ON_MACRO, ON_NAVIGATION, ON_NAVIGATION_FOLDER, ON_NAVIGATION_FORM, ON_NAVIGATION_WEBPART, ON_NEW_ITEM, ON_NEW_SELECTED, ON_OK, ON_ONEDRIVE_LOGIN, ON_OPEN_INDEX_MASK, ON_OPEN_MASK, ON_OPEN_QUERY_MASK, ON_PASSWORD_EXPIRED, ON_PRINT_DOCUMENTS, ON_QUERY, ON_QUERY_FAVORITE, ON_REFRESH, ON_REFRESH_FOLDER, ON_RESET_GUI, ON_REVISION_CREATED, ON_SAVE_AND, ON_SAVE_DOC, ON_SAVE_FOLDER, ON_SCROLL_NODE, ON_SELECT_TREE_ITEM, ON_SELECTDDC, ON_SEND_MAIL_RESULTITEM, ON_SET_LITIGATION_HOLD, ON_SHAREBASE_DOCUMENT_CHECK, ON_SHAREBASE_LOGIN, ON_START_WORKFLOW, ON_TAB_SELECTED, ON_UNDELETE_SELECTED, ON_UPLOAD_DOCUMENT, ON_UPLOAD_EXTERNAL_STORAGE_DOCUMENT, ON_UPLOAD_SUCCESS, ON_VARIABLES_AVAILABLE, ON_WF, ON_WF_COMMENT_DIALOG_CANCEL, ON_WF_COMMENT_DIALOG_OK, ON_WFCOMMENTS, ON_WFDELEGATE, ON_WFFORWARD, ON_WFFORWARD1, ON_WFFORWARD2, ON_WFFORWARD3, ON_WFFORWARD4, ON_WFFORWARD5, ON_WFHISTORY, ON_WFPUTBACK, ON_WFREMINDER, ON_WFTAKE, ON_WORKFLOW_ACTION, ON_WORKFLOW_COMMENT, ON_WORKFLOW_DISPLAY_COMMENT
-
-
Constructor Summary
Constructors Constructor Description AbstractDocumentView()Standard Constructor.AbstractDocumentView(java.lang.String documentViewTitle, java.lang.String documentViewBorder, java.lang.Boolean closable)Constructor with title, border, closable option.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleancanDownload(DocumentId documentId)Checks if the user is allowed to download the document.booleancanModifyDocument()Checks if theViewerComponentused by this viewer can modify documents.booleancanShowRevisions()Checks if theViewerComponentused by this viewer can show the document revisions.protected booleancanView(DocumentId documentId)Checks if the user is allowed to display the document.voiddisable()Disables the viewer.voidenable()Enables the viewer.protected voidenableStructureButtonsWhen(boolean enable)protected voidfillStructureView(java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> infos, DocumentId documentId)Fills the structure list with available documents to show in the viewer component.protected java.lang.StringgenerateRandomViewerId()Generates a random ID used to identify each viewer.protected DocumentArchiveMetaInfo.ElementArchiveMetaInfogetElementMetaInfo(java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentTitles, int element)Gets information about a specific element.protected javax.servlet.http.HttpServletRequestgetNativeRequest()Gets the native request.protected java.io.InputStreamgetPageListStream(DocumentId documentId, java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentElements)IntelligentFormViewgetParentForm()Gets the parent form of this DocumentView.DocumentViewPresentergetPresenter()Gets the presenter.java.lang.StringgetPropertiesFileName()Gets the properties file name.StructureList<?>getStructureList()Gets the structure list.java.lang.StringgetViewerClass()Gets the class-name of the contained viewer-component.booleanhasOpenChanges()Check open changes in viewer.protected booleaninIfomPopup()protected voidinit()Initializes the viewer classes by setting things like layout, max view size, max document size and so on.booleanisEnableLoadingMessage()protected booleanisSizeLimitEnabled()Tells if the size limit for viewing documents is enabled.booleanisStructureButtonsBoxShown()Tells you if the structure buttons of the structure view are shown or not.booleanisStructureEnabled()protected voidmakeViewerBean(DocumentId documentId, java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentElements, boolean currentRevision)Creates a new viewer control-bean or updates the existing one.abstract voidonCreate(org.zkoss.zk.ui.event.Event event)Event handler for onCreate event.abstract voidonDisplayResultItem(org.zkoss.zk.ui.event.Event event)Display document.voidonLogon(org.zkoss.zk.ui.event.Event event)Event handler for logon event.voidonResetGui(org.zkoss.zk.ui.event.Event event)Handler for reset ui event.abstract voidopenDocument(DocumentId documentId, java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentElements, int element)Opens the specified url and displays the document.voidopenSubDocument()Opens a sub document structure.voidrefreshView()Refreshes the view with the last opened document.voidreset()Closes the current document.voidreset(boolean showInitImage)Closes the current document.voidsetEnableLoadingMessage(boolean enable)Enables or disables the loading message that will be shown when the viewer is initiated.voidsetPropertiesFileName(java.lang.String filename)Sets the name of a properties file for the internal viewer component.voidsetStructureButtonsBoxShown(boolean showStructureButtonsBox)Set the visibility of the its structure button box and its containingn structure buttons of the structure view.voidsetStructureEnabled(boolean enabled)Enables or disables the structure view.voidsetViewerClass(java.lang.String clazz)Sets the class-name of the contained viewer-component.-
Methods inherited from class com.saperion.ngc.events.BaseWindow
getEventtarget, getMainWindow, postAddLinkEvent, postAddToFavoritesEvent, postCancelSelectedEvent, postChangeDocumentSecurityEvent, postChangeFolderSecurityEvent, postDeleteSelectedEvent, postDisplayPopupEvent, postDisplayPopupEvent, postDisplayPopupEvent, postDisplayResultItemEvent, postDisplayResultItemEvent, postDocumentCheckEvent, postDocumentCheckWithShareBaseEvent, postDocumentFilingEvent, postDocumentFilingEvent, postDocumentReleaseEvent, postDownloadResultItemEvent, postEditContentEvent, postEditItemSelectedEvent, postEditSelectedEvent, postEditSelectedEvent, postEditSelectedEvent, postEditStructureEvent, postErrorLogEvent, postErrorLogEvent, postExternalStorageUploadEvent, postExternalStorageUploadStatusEvent, postFieldChangeEvent, postFileActionEvent, postFileActionEvent, postFormButtonEvent, postIndexResultItemEvent, postInfoLogEvent, postInfoLogEvent, postLaunchWorkflowEvent, postLockDocumentEvent, postLogonEvent, postLogonEvent, postNavigationFolderEvent, postNavigationFormEvent, postNavigationFormEvent, postNavigationWebpartEvent, postNewSelectedEvent, postOpenMaskEvent, postPrintDocumentEvent, postProlongRetentionEvent, postQueryFavoriteEvent, postReduceDispositionEvent, postRefreshEvent, postResetGuiEvent, postResultFieldEvent, postSaveDocumentEvent, postSaveDocumentEvent, postSelectTreeItemEvent, postSendMailResultItemEvent, postSetLitigationHoldEvent, postShareBaseLoginEvent, postStartWorkflowEvent, postTabSelectedEvent, postUnDeleteSelectedEvent, postUploadDocumentEvent, postUploadeExternalStorageDocumentEvent, postUploadSuccessEvent, postWarningLogEvent, postWarningLogEvent, postWorkflowActionEvent, postWorkflowCommentEvent, postWorkflowDisplayCommentEvent, setEventtarget
-
Methods inherited from class org.zkoss.zul.Window
beforeChildAdded, clone, doEmbedded, doHighlighted, doModal, doOverlapped, doPopup, getBorder, getCaption, getContentSclass, getContentStyle, getDefaultActionOnShow, getMinheight, getMinwidth, getMode, getModeType, getPosition, getTitle, getZclass, inEmbedded, inHighlighted, inModal, inOverlapped, inPopup, insertBefore, isClosable, isCollapsible, isMaximizable, isMaximized, isMinimizable, isMinimized, isShadow, isSizable, onChildRemoved, onClose, onModal, onPageDetached, renderProperties, service, setBorder, setBorder, setClosable, setContentSclass, setContentStyle, setDefaultActionOnShow, setDraggable, setMaximizable, setMaximized, setMinheight, setMinimizable, setMinimized, setMinwidth, setMode, setMode, setMode, setPosition, setShadow, setSizable, setTitle, setTopmost, setVisible
-
Methods inherited from class org.zkoss.zul.impl.XulElement
getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
-
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
-
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onPageAttached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientAttribute, getClientDataAttribute, getDefinition, getDesktop, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getShadowVariable, getShadowVariable, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, query, queryAll, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setTemplate, setVisible, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride
-
Methods inherited from interface com.saperion.ngc.viewer.DocumentView
handleLinkElement, openDocument, openTemporaryDocument
-
Methods inherited from interface com.saperion.ngc.events.EventChild
getEventtarget, setEventtarget
-
Methods inherited from interface com.saperion.ngc.events.EventChildHandler
postAddLinkEvent, postAddToFavoritesEvent, postCancelSelectedEvent, postChangeDocumentSecurityEvent, postChangeFolderSecurityEvent, postDeleteSelectedEvent, postDisplayPopupEvent, postDisplayPopupEvent, postDisplayPopupEvent, postDisplayResultItemEvent, postDisplayResultItemEvent, postDocumentCheckEvent, postDocumentCheckWithShareBaseEvent, postDocumentFilingEvent, postDocumentFilingEvent, postDocumentReleaseEvent, postDownloadResultItemEvent, postEditContentEvent, postEditItemSelectedEvent, postEditSelectedEvent, postEditSelectedEvent, postEditSelectedEvent, postEditStructureEvent, postExternalStorageUploadEvent, postExternalStorageUploadStatusEvent, postFieldChangeEvent, postFileActionEvent, postFileActionEvent, postFormButtonEvent, postIndexResultItemEvent, postLaunchWorkflowEvent, postLockDocumentEvent, postLogonEvent, postLogonEvent, postNavigationFolderEvent, postNavigationFormEvent, postNavigationFormEvent, postNavigationWebpartEvent, postNewSelectedEvent, postOpenMaskEvent, postPrintDocumentEvent, postProlongRetentionEvent, postQueryFavoriteEvent, postReduceDispositionEvent, postRefreshEvent, postResetGuiEvent, postResultFieldEvent, postSaveDocumentEvent, postSaveDocumentEvent, postSelectTreeItemEvent, postSendMailResultItemEvent, postSetLitigationHoldEvent, postShareBaseLoginEvent, postStartWorkflowEvent, postTabSelectedEvent, postUnDeleteSelectedEvent, postUploadDocumentEvent, postUploadeExternalStorageDocumentEvent, postUploadSuccessEvent, postWorkflowActionEvent, postWorkflowCommentEvent, postWorkflowDisplayCommentEvent
-
Methods inherited from interface org.zkoss.zk.ui.IdSpace
getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, hasFellow, hasFellow
-
Methods inherited from interface com.saperion.ngc.events.LogEventChildHandler
postErrorLogEvent, postErrorLogEvent, postInfoLogEvent, postInfoLogEvent, postWarningLogEvent, postWarningLogEvent
-
-
-
-
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.
-
viewerBean
protected OpenDocumentBean viewerBean
Viewer's control-bean.
-
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- TitledocumentViewBorder- Borderclosable- Closable
-
AbstractDocumentView
public AbstractDocumentView()
Standard Constructor.
-
-
Method Detail
-
openDocument
public abstract void openDocument(DocumentId documentId, java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentElements, int element)
Opens the specified url and displays the document.- Specified by:
openDocumentin interfaceDocumentView- Parameters:
documentId- the document's iddocumentElements- the document's elements (sub documents)element- document element- See Also:
DocumentView.openDocument(com.saperion.ngc.model.document.DocumentId, java.util.List, int)
-
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:
onDisplayResultItemin interfaceDocumentView- 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.
-
openSubDocument
public void openSubDocument()
Opens a sub document structure.- Specified by:
openSubDocumentin interfaceDocumentView- See Also:
DocumentView.openSubDocument()
-
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:
onLogonin interfaceDocumentView- Parameters:
event- ZK event
-
disable
public final void disable()
Disables the viewer.- Specified by:
disablein interfaceDocumentView
-
enable
public final void enable()
Enables the viewer.- Specified by:
enablein interfaceDocumentView
-
reset
public final void reset()
Closes the current document.- Specified by:
resetin interfaceDocumentView
-
reset
public final void reset(boolean showInitImage)
Closes the current document.- Specified by:
resetin interfaceDocumentView- 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:
onResetGuiin interfaceDocumentView- Parameters:
event- ZK event
-
refreshView
public final void refreshView()
Refreshes the view with the last opened document.- Specified by:
refreshViewin interfaceDocumentView
-
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 informationdocumentId- id of the document
-
getPresenter
public DocumentViewPresenter getPresenter()
Gets the presenter.- Returns:
- the presenter
-
getElementMetaInfo
protected DocumentArchiveMetaInfo.ElementArchiveMetaInfo getElementMetaInfo(java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentTitles, int element)
Gets information about a specific element.- Parameters:
documentTitles- structure informationelement- the element number- Returns:
- the element's meta info
-
setPropertiesFileName
public void setPropertiesFileName(java.lang.String filename)
Sets the name of a properties file for the internal viewer component. Optional parameter.- Specified by:
setPropertiesFileNamein interfaceDocumentView- Parameters:
filename- the new properties file name- See Also:
DocumentView.setPropertiesFileName(java.lang.String)
-
getPropertiesFileName
public java.lang.String getPropertiesFileName()
Gets the properties file name.- Specified by:
getPropertiesFileNamein interfaceDocumentView- Returns:
- the properties file name
- See Also:
DocumentView.getPropertiesFileName()
-
hasOpenChanges
public boolean hasOpenChanges()
Check open changes in viewer.- Specified by:
hasOpenChangesin interfaceDocumentView- Returns:
- True, if open changes
- See Also:
DocumentView.hasOpenChanges()
-
getStructureList
public StructureList<?> getStructureList()
Gets the structure list.- Specified by:
getStructureListin interfaceDocumentView- Returns:
- the structure list
- See Also:
DocumentView.getStructureList()
-
getParentForm
public IntelligentFormView getParentForm()
Gets the parent form of this DocumentView.- Specified by:
getParentFormin interfaceDocumentView- Returns:
- the parent form
-
getPageListStream
protected java.io.InputStream getPageListStream(DocumentId documentId, java.util.List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentElements)
- Parameters:
documentId- ID of the documentdocumentElements- 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 iddocumentElements- elements of the documentcurrentRevision- 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:
setEnableLoadingMessagein interfaceDocumentView- Parameters:
enable- enabled or disabled- See Also:
DocumentView.setEnableLoadingMessage(boolean)
-
isEnableLoadingMessage
public boolean isEnableLoadingMessage()
- Specified by:
isEnableLoadingMessagein interfaceDocumentView- Returns:
- true if loading message is enabled
- See Also:
DocumentView.isEnableLoadingMessage()
-
setViewerClass
public void setViewerClass(java.lang.String clazz)
Sets the class-name of the contained viewer-component.- Specified by:
setViewerClassin interfaceDocumentView- Parameters:
clazz- the class-name of the viewer-component- See Also:
DocumentView.setViewerClass(java.lang.String)
-
getViewerClass
public java.lang.String getViewerClass()
Gets the class-name of the contained viewer-component.- Specified by:
getViewerClassin interfaceDocumentView- Returns:
- the class-name of the contained viewer-component.
- See Also:
DocumentView.getViewerClass()
-
setStructureButtonsBoxShown
public void setStructureButtonsBoxShown(boolean showStructureButtonsBox)
Description copied from interface:DocumentViewSet the visibility of the its structure button box and its containingn structure buttons of the structure view.- Specified by:
setStructureButtonsBoxShownin interfaceDocumentView- 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:DocumentViewTells you if the structure buttons of the structure view are shown or not. Default is true.- Specified by:
isStructureButtonsBoxShownin interfaceDocumentView- 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
-
setStructureEnabled
public void setStructureEnabled(boolean enabled)
Enables or disables the structure view.- Specified by:
setStructureEnabledin interfaceDocumentView- Parameters:
enabled- enabled/disabled- See Also:
DocumentView.setStructureEnabled(boolean)
-
isStructureEnabled
public boolean isStructureEnabled()
- Specified by:
isStructureEnabledin interfaceDocumentView- Returns:
- true if structure view is enabled
- See Also:
DocumentView.isStructureEnabled()
-
canModifyDocument
public boolean canModifyDocument()
Description copied from interface:DocumentViewChecks if theViewerComponentused by this viewer can modify documents.- Specified by:
canModifyDocumentin interfaceDocumentView- Returns:
- can edit documents
-
canShowRevisions
public boolean canShowRevisions()
Description copied from interface:DocumentViewChecks if theViewerComponentused by this viewer can show the document revisions.- Specified by:
canShowRevisionsin interfaceDocumentView- Returns:
- true or false
- See Also:
DocumentView.canShowRevisions()
-
-