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.HistoryHandlerNested 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.PositionCallbackNested 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.DebugIdImplEnabledNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected I_CmsUploadContextThe upload context.protected com.google.gwt.user.client.ui.HTMLThe drag and drop message.protected CmsScrollPanelThe 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_WIDTHFields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gwt.event.shared.HandlerRegistrationaddCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> handler) protected voidaddFileInput(CmsFileInput fileInput) Adds the given file input field to this dialog.protected voidaddFiles(List<CmsFileInfo> fileInfos) Adds the given file input field to this dialog.protected voidCancels the upload progress timer.protected voidCancels the upload.abstract org.opencms.gwt.shared.CmsListInfoBeancreateInfoBean(CmsFileInfo file) Creates a bean that can be used for the list item widget.protected voidCreates the loading animation HTML and adds is to the content wrapper.protected voiddisableOKButton(String disabledReason) Disables the OK button.protected voiddoResize()Required to be called when the content has changed.protected voidEnables the OK button.protected longReturns the contentLength.protected com.google.gwt.user.client.ui.FlowPanelReturns the contentWrapper.abstract StringReturns 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 StringReturns "files" or "file" depending on the files to upload.protected StringGets the post-create handler.protected StringgetResourceType(CmsFileInfo file) Returns the resource type name for a given filename.protected StringReturns the targetFolder.protected org.opencms.gwt.shared.rpc.I_CmsUploadServiceAsyncReturns the upload service instance.protected StringReturns the upload JSP uri.protected voidinsertUploadForm(com.google.gwt.user.client.ui.FormPanel form) Inserts a hidden form into.abstract booleanisTooLarge(CmsFileInfo cmsFileInfo) Returnstrueif the file is too large,falseotherwise.voidLoads and shows this dialog.protected voidThe action that is executed if the user clicks on the OK button.protected voidonResize()Required to be called when the content has changed.voidparseResponse(String results) Parses the upload response.protected voidproceedWorkflow(org.opencms.gwt.shared.CmsUploadFileBean result) Decides how to go on depending on the information of the server response.protected voidRemoves the drag and drop message.protected voidsetContentLength(long contentLength) Sets the contentLength.protected voidExecute to set the content wrapper height.voidsetContext(I_CmsUploadContext context) Sets the upload context.protected voidDisplays the 'use drag and drop' / 'no drag and drop available' message.voidsetIsTargetRootPath(boolean isTargetRootPath) Sets the boolean flag to control whether the target folder is interpreted as a root path.voidsetPostCreateHandler(String postCreateHandler) Sets the post-create handler.protected voidsetSummaryHTML(String html) Sets the HTML of the selection summary.voidsetTargetFolder(String target) Sets the target folder.voidshowErrorReport(String message, String stacktrace) Shows the error report.voidsubmit()Executes the submit action.voidUpdates the button handler.protected voidRetrieves the progress information from the server.protected voidupdateProgressBar(org.opencms.gwt.shared.CmsUploadProgessInfo info) Updates the progress bar.abstract voidUpdates 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, wrapWithBorderPaddingMethods 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, showRelativeToMethods inherited from class com.google.gwt.user.client.ui.SimplePanel
getWidget, setWidgetMethods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, orphan, removeMethods 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, unsinkEventsMethods 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEventMethods inherited from interface org.opencms.gwt.client.ui.I_CmsAutoHider
addAutoHidePartner, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, removeAutoHidePartner, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabledMethods 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
Returnstrueif the file is too large,falseotherwise.- Parameters:
cmsFileInfo- the file to check- Returns:
trueif the file is too large,falseotherwise
-
loadAndShow
Loads and shows this dialog. -
parseResponse
Description copied from interface:I_CmsUploadDialogParses the upload response.- Specified by:
parseResponsein 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:
showErrorReportin 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-trueif the returned list should contain those filenames that are not inside the map of files to upload.falseonly 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.