Package org.opencms.ade.upload.client.ui
Class A_CmsUploadDialog
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.SimplePanel
com.google.gwt.user.client.ui.PopupPanel
org.opencms.gwt.client.ui.CmsPopup
org.opencms.ade.upload.client.ui.A_CmsUploadDialog
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers
,com.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>
,com.google.gwt.event.shared.HasHandlers
,com.google.gwt.user.client.EventListener
,com.google.gwt.user.client.EventPreview
,com.google.gwt.user.client.ui.AcceptsOneWidget
,com.google.gwt.user.client.ui.HasAnimation
,com.google.gwt.user.client.ui.HasOneWidget
,com.google.gwt.user.client.ui.HasVisibility
,com.google.gwt.user.client.ui.HasWidgets
,com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
,com.google.gwt.user.client.ui.IsWidget
,com.google.gwt.user.client.ui.SourcesPopupEvents
,Iterable<com.google.gwt.user.client.ui.Widget>
,I_CmsAutoHider
,I_CmsUploadDialog
- Direct Known Subclasses:
CmsUploadDialogFormDataImpl
,CmsUploadDialogImpl
Provides an upload dialog.
- Since:
- 8.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencms.gwt.client.ui.CmsPopup
CmsPopup.HistoryHandler
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel
com.google.gwt.user.client.ui.PopupPanel.AnimationType, com.google.gwt.user.client.ui.PopupPanel.PositionCallback
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
-
Field Summary
Modifier and TypeFieldDescriptionprotected I_CmsUploadContext
The upload context.protected com.google.gwt.user.client.ui.HTML
The drag and drop message.protected CmsScrollPanel
The scroll panel.The uploaded file names.Fields inherited from class org.opencms.gwt.client.ui.CmsPopup
DEFAULT_WIDTH, m_closeCommand, m_notificationWidgetInstalled, m_windowWidth, WIDE_WIDTH
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.gwt.event.shared.HandlerRegistration
addCloseHandler
(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> handler) protected void
addFileInput
(CmsFileInput fileInput) Adds the given file input field to this dialog.protected void
addFiles
(List<CmsFileInfo> fileInfos) Adds the given file input field to this dialog.protected void
Cancels the upload progress timer.protected void
Cancels the upload.abstract org.opencms.gwt.shared.CmsListInfoBean
createInfoBean
(CmsFileInfo file) Creates a bean that can be used for the list item widget.protected void
Creates the loading animation HTML and adds is to the content wrapper.protected void
disableOKButton
(String disabledReason) Disables the OK button.protected void
doResize()
Required to be called when the content has changed.protected void
Enables the OK button.protected long
Returns the contentLength.protected com.google.gwt.user.client.ui.FlowPanel
Returns the contentWrapper.abstract String
Returns the massage for too large files.getFilesToUnzip
(boolean all) Returns the list of file names that have to unziped.protected Map<String,
CmsFileInfo> Returns the filesToUpload.protected String
Returns "files" or "file" depending on the files to upload.protected String
Gets the post-create handler.protected String
getResourceType
(CmsFileInfo file) Returns the resource type name for a given filename.protected String
Returns the targetFolder.protected org.opencms.gwt.shared.rpc.I_CmsUploadServiceAsync
Returns the upload service instance.protected String
Returns the upload JSP uri.protected void
insertUploadForm
(com.google.gwt.user.client.ui.FormPanel form) Inserts a hidden form into.abstract boolean
isTooLarge
(CmsFileInfo cmsFileInfo) Returnstrue
if the file is too large,false
otherwise.void
Loads and shows this dialog.protected void
The action that is executed if the user clicks on the OK button.protected void
onResize()
Required to be called when the content has changed.void
parseResponse
(String results) Parses the upload response.protected void
proceedWorkflow
(org.opencms.gwt.shared.CmsUploadFileBean result) Decides how to go on depending on the information of the server response.protected void
Removes the drag and drop message.protected void
setContentLength
(long contentLength) Sets the contentLength.protected void
Execute to set the content wrapper height.void
setContext
(I_CmsUploadContext context) Sets the upload context.protected void
Displays the 'use drag and drop' / 'no drag and drop available' message.void
setIsTargetRootPath
(boolean isTargetRootPath) Sets the boolean flag to control whether the target folder is interpreted as a root path.void
setPostCreateHandler
(String postCreateHandler) Sets the post-create handler.protected void
setSummaryHTML
(String html) Sets the HTML of the selection summary.void
setTargetFolder
(String target) Sets the target folder.void
showErrorReport
(String message, String stacktrace) Shows the error report.void
submit()
Executes the submit action.void
Updates the button handler.protected void
Retrieves the progress information from the server.protected void
updateProgressBar
(org.opencms.gwt.shared.CmsUploadProgessInfo info) Updates the progress bar.abstract void
Updates the file summary.Methods inherited from class org.opencms.gwt.client.ui.CmsPopup
add, add, addButton, addButton, addDialogClose, adjustIndex, beginDragging, catchNotifications, center, centerHorizontally, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, clear, continueDragging, createDialogNotificationWidget, doAttachChildren, doDetachChildren, endDragging, getAvailableHeight, getCaption, getChildren, getContainerElement, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, getWidth, hasCaption, hide, hide, insert, insert, insertFront, installNotificationWidget, iterator, onBrowserEvent, onDetach, onPreviewNativeEvent, remove, remove, removeAllButtons, removeButton, removePadding, setBackgroundColor, setCaption, setHeight, setHeight, setMainContent, setPixelSize, setPositionFixed, setSize, setSpecialBackgroundClass, setUseAnimation, setWidget, setWidth, setWidth, show, showArrow, wrapWithBorderPadding
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addPopupListener, getAnimationType, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onUnload, removeAutoHidePartner, removePopupListener, setAnimationEnabled, setAnimationType, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled, setGlassEnabled, setGlassStyleName, setModal, setPopupPosition, setPopupPositionAndShow, setPreviewingAllNativeEvents, setTitle, setVisible, showRelativeTo
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
getWidget, setWidget
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, orphan, remove
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onLoad, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
Methods inherited from interface org.opencms.gwt.client.ui.I_CmsAutoHider
addAutoHidePartner, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, removeAutoHidePartner, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
m_context
The upload context. -
m_dragAndDropMessage
The drag and drop message. -
m_scrollPanel
The scroll panel. -
m_uploadedFiles
The uploaded file names.
-
-
Constructor Details
-
A_CmsUploadDialog
public A_CmsUploadDialog()Default constructor.
-
-
Method Details
-
createInfoBean
Creates a bean that can be used for the list item widget.- Parameters:
file
- the info to create the bean for- Returns:
- a list info bean
-
getFileSizeTooLargeMessage
Returns the massage for too large files.- Parameters:
file
- the file- Returns:
- the message
-
isTooLarge
Returnstrue
if the file is too large,false
otherwise.- Parameters:
cmsFileInfo
- the file to check- Returns:
true
if the file is too large,false
otherwise
-
loadAndShow
Loads and shows this dialog. -
parseResponse
Description copied from interface:I_CmsUploadDialog
Parses the upload response.- Specified by:
parseResponse
in interfaceI_CmsUploadDialog
- Parameters:
results
- the upload response- See Also:
-
setContext
Sets the upload context.- Parameters:
context
- the new upload context
-
setIsTargetRootPath
Sets the boolean flag to control whether the target folder is interpreted as a root path.- Parameters:
isTargetRootPath
- true if the target folder should be treated as a root path
-
setPostCreateHandler
Sets the post-create handler.- Parameters:
postCreateHandler
- the post-create handler
-
setTargetFolder
Sets the target folder.- Parameters:
target
- the target folder to set
-
showErrorReport
Shows the error report.- Specified by:
showErrorReport
in interfaceI_CmsUploadDialog
- Parameters:
message
- the message to showstacktrace
- the stacktrace to show
-
submit
Executes the submit action. -
updateHandler
Updates the button handler. -
updateSummary
Updates the file summary. -
addFileInput
Adds the given file input field to this dialog.- Parameters:
fileInput
- the file input field to add
-
addFiles
Adds the given file input field to this dialog.- Parameters:
fileInfos
- the file info objects
-
cancelUpdateProgress
Cancels the upload progress timer. -
cancelUpload
Cancels the upload. -
createLoadingAnimation
Creates the loading animation HTML and adds is to the content wrapper.- Parameters:
msg
- the message to display below the animation
-
disableOKButton
Disables the OK button.- Parameters:
disabledReason
- the reason for disabling the OK button
-
doResize
Required to be called when the content has changed. -
enableOKButton
Enables the OK button. -
getContentLength
Returns the contentLength.- Returns:
- the contentLength
-
getContentWrapper
Returns the contentWrapper.- Returns:
- the contentWrapper
-
getFilesToUnzip
Returns the list of file names that have to unziped.- Parameters:
all
-true
if the returned list should contain those filenames that are not inside the map of files to upload.false
only those filenames are returned that are also inside the map of files to upload- Returns:
- the list of file names that have to unziped
-
getFilesToUpload
Returns the filesToUpload.- Returns:
- the filesToUpload
-
getFileText
Returns "files" or "file" depending on the files to upload.- Returns:
- "files" or "file" depending on the files to upload
-
getPostCreateHandler
Gets the post-create handler.- Returns:
- the post-create handler
-
getResourceType
Returns the resource type name for a given filename.- Parameters:
file
- the file info- Returns:
- the resource type name
-
getTargetFolder
Returns the targetFolder.- Returns:
- the targetFolder
-
getUploadService
Returns the upload service instance.- Returns:
- the upload service instance
-
getUploadUri
Returns the upload JSP uri.- Returns:
- the upload JSP uri
-
insertUploadForm
Inserts a hidden form into.- Parameters:
form
- the form to insert
-
onOkClick
The action that is executed if the user clicks on the OK button.If the selection dialog is currently shown the selected files are checked otherwise the upload is triggered.
-
onResize
Required to be called when the content has changed. -
removeDragAndDropMessage
Removes the drag and drop message. -
setContentLength
Sets the contentLength.- Parameters:
contentLength
- the contentLength to set
-
setContentWrapperHeight
Execute to set the content wrapper height. -
setDragAndDropMessage
Displays the 'use drag and drop' / 'no drag and drop available' message. -
setSummaryHTML
Sets the HTML of the selection summary.- Parameters:
html
- the HTML to set as String
-
updateProgress
Retrieves the progress information from the server.