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
,java.lang.Iterable<com.google.gwt.user.client.ui.Widget>
,I_CmsAutoHider
,I_CmsUploadDialog
- Direct Known Subclasses:
CmsUploadDialogFormDataImpl
,CmsUploadDialogImpl
public abstract class A_CmsUploadDialog extends CmsPopup implements I_CmsUploadDialog
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
-
-
Field Summary
Fields Modifier and Type Field Description protected I_CmsUploadContext
m_context
The upload context.protected com.google.gwt.user.client.ui.HTML
m_dragAndDropMessage
The drag and drop message.protected CmsScrollPanel
m_scrollPanel
The scroll panel.protected java.util.List<java.lang.String>
m_uploadedFiles
The uploaded file names.-
Fields inherited from class org.opencms.gwt.client.ui.CmsPopup
DEFAULT_WIDTH, m_closeCommand, m_notificationWidgetInstalled, m_windowWidth, WIDE_WIDTH
-
-
Constructor Summary
Constructors Constructor Description A_CmsUploadDialog()
Default constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description com.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(java.util.List<CmsFileInfo> fileInfos)
Adds the given file input field to this dialog.protected void
cancelUpdateProgress()
Cancels the upload progress timer.protected void
cancelUpload()
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
createLoadingAnimation(java.lang.String msg)
Creates the loading animation HTML and adds is to the content wrapper.protected void
disableOKButton(java.lang.String disabledReason)
Disables the OK button.protected void
doResize()
Required to be called when the content has changed.protected void
enableOKButton()
Enables the OK button.protected long
getContentLength()
Returns the contentLength.protected com.google.gwt.user.client.ui.FlowPanel
getContentWrapper()
Returns the contentWrapper.abstract java.lang.String
getFileSizeTooLargeMessage(CmsFileInfo file)
Returns the massage for too large files.protected java.util.List<java.lang.String>
getFilesToUnzip(boolean all)
Returns the list of file names that have to unziped.protected java.util.Map<java.lang.String,CmsFileInfo>
getFilesToUpload()
Returns the filesToUpload.protected java.lang.String
getFileText()
Returns "files" or "file" depending on the files to upload.protected java.lang.String
getPostCreateHandler()
Gets the post-create handler.protected java.lang.String
getResourceType(CmsFileInfo file)
Returns the resource type name for a given filename.protected java.lang.String
getTargetFolder()
Returns the targetFolder.protected org.opencms.gwt.shared.rpc.I_CmsUploadServiceAsync
getUploadService()
Returns the upload service instance.protected java.lang.String
getUploadUri()
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
loadAndShow()
Loads and shows this dialog.protected void
onOkClick()
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(java.lang.String results)
Parses the upload response of the server and decides what to do.protected void
proceedWorkflow(org.opencms.gwt.shared.CmsUploadFileBean result)
Decides how to go on depending on the information of the server response.protected void
removeDragAndDropMessage()
Removes the drag and drop message.protected void
setContentLength(long contentLength)
Sets the contentLength.protected void
setContentWrapperHeight()
Execute to set the content wrapper height.void
setContext(I_CmsUploadContext context)
Sets the upload context.protected void
setDragAndDropMessage()
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(java.lang.String postCreateHandler)
Sets the post-create handler.protected void
setSummaryHTML(java.lang.String html)
Sets the HTML of the selection summary.void
setTargetFolder(java.lang.String target)
Sets the target folder.void
showErrorReport(java.lang.String message, java.lang.String stacktrace)
Shows the error report.void
submit()
Executes the submit action.void
updateHandler()
Updates the button handler.protected void
updateProgress()
Retrieves the progress information from the server.protected void
updateProgressBar(org.opencms.gwt.shared.CmsUploadProgessInfo info)
Updates the progress bar.abstract void
updateSummary()
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.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 org.opencms.gwt.client.ui.I_CmsAutoHider
addAutoHidePartner, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, removeAutoHidePartner, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled
-
-
-
-
Field Detail
-
m_context
protected I_CmsUploadContext m_context
The upload context.
-
m_dragAndDropMessage
protected com.google.gwt.user.client.ui.HTML m_dragAndDropMessage
The drag and drop message.
-
m_scrollPanel
protected CmsScrollPanel m_scrollPanel
The scroll panel.
-
m_uploadedFiles
protected java.util.List<java.lang.String> m_uploadedFiles
The uploaded file names.
-
-
Constructor Detail
-
A_CmsUploadDialog
public A_CmsUploadDialog()
Default constructor.
-
-
Method Detail
-
addCloseHandler
public com.google.gwt.event.shared.HandlerRegistration addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> handler)
- Specified by:
addCloseHandler
in interfacecom.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>
- Overrides:
addCloseHandler
in classcom.google.gwt.user.client.ui.PopupPanel
- See Also:
PopupPanel.addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler)
-
createInfoBean
public abstract org.opencms.gwt.shared.CmsListInfoBean createInfoBean(CmsFileInfo file)
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
public abstract java.lang.String getFileSizeTooLargeMessage(CmsFileInfo file)
Returns the massage for too large files.- Parameters:
file
- the file- Returns:
- the message
-
isTooLarge
public abstract boolean isTooLarge(CmsFileInfo cmsFileInfo)
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
public void loadAndShow()
Loads and shows this dialog.
-
parseResponse
public void parseResponse(java.lang.String results)
Parses the upload response of the server and decides what to do.- Specified by:
parseResponse
in interfaceI_CmsUploadDialog
- Parameters:
results
- a JSON Object
-
setContext
public void setContext(I_CmsUploadContext context)
Sets the upload context.- Parameters:
context
- the new upload context
-
setIsTargetRootPath
public void setIsTargetRootPath(boolean isTargetRootPath)
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
public void setPostCreateHandler(java.lang.String postCreateHandler)
Sets the post-create handler.- Parameters:
postCreateHandler
- the post-create handler
-
setTargetFolder
public void setTargetFolder(java.lang.String target)
Sets the target folder.- Parameters:
target
- the target folder to set
-
showErrorReport
public void showErrorReport(java.lang.String message, java.lang.String stacktrace)
Shows the error report.- Specified by:
showErrorReport
in interfaceI_CmsUploadDialog
- Parameters:
message
- the message to showstacktrace
- the stacktrace to show
-
submit
public void submit()
Executes the submit action.
-
updateHandler
public void updateHandler()
Updates the button handler.
-
updateSummary
public abstract void updateSummary()
Updates the file summary.
-
addFileInput
protected void addFileInput(CmsFileInput fileInput)
Adds the given file input field to this dialog.- Parameters:
fileInput
- the file input field to add
-
addFiles
protected void addFiles(java.util.List<CmsFileInfo> fileInfos)
Adds the given file input field to this dialog.- Parameters:
fileInfos
- the file info objects
-
cancelUpdateProgress
protected void cancelUpdateProgress()
Cancels the upload progress timer.
-
cancelUpload
protected void cancelUpload()
Cancels the upload.
-
createLoadingAnimation
protected void createLoadingAnimation(java.lang.String msg)
Creates the loading animation HTML and adds is to the content wrapper.- Parameters:
msg
- the message to display below the animation
-
disableOKButton
protected void disableOKButton(java.lang.String disabledReason)
Disables the OK button.- Parameters:
disabledReason
- the reason for disabling the OK button
-
doResize
protected void doResize()
Required to be called when the content has changed.
-
enableOKButton
protected void enableOKButton()
Enables the OK button.
-
getContentLength
protected long getContentLength()
Returns the contentLength.- Returns:
- the contentLength
-
getContentWrapper
protected com.google.gwt.user.client.ui.FlowPanel getContentWrapper()
Returns the contentWrapper.- Returns:
- the contentWrapper
-
getFilesToUnzip
protected java.util.List<java.lang.String> getFilesToUnzip(boolean all)
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
protected java.util.Map<java.lang.String,CmsFileInfo> getFilesToUpload()
Returns the filesToUpload.- Returns:
- the filesToUpload
-
getFileText
protected java.lang.String getFileText()
Returns "files" or "file" depending on the files to upload.- Returns:
- "files" or "file" depending on the files to upload
-
getPostCreateHandler
protected java.lang.String getPostCreateHandler()
Gets the post-create handler.- Returns:
- the post-create handler
-
getResourceType
protected java.lang.String getResourceType(CmsFileInfo file)
Returns the resource type name for a given filename.- Parameters:
file
- the file info- Returns:
- the resource type name
-
getTargetFolder
protected java.lang.String getTargetFolder()
Returns the targetFolder.- Returns:
- the targetFolder
-
getUploadService
protected org.opencms.gwt.shared.rpc.I_CmsUploadServiceAsync getUploadService()
Returns the upload service instance.- Returns:
- the upload service instance
-
getUploadUri
protected java.lang.String getUploadUri()
Returns the upload JSP uri.- Returns:
- the upload JSP uri
-
insertUploadForm
protected void insertUploadForm(com.google.gwt.user.client.ui.FormPanel form)
Inserts a hidden form into.- Parameters:
form
- the form to insert
-
onOkClick
protected void 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
protected void onResize()
Required to be called when the content has changed.
-
proceedWorkflow
protected void proceedWorkflow(org.opencms.gwt.shared.CmsUploadFileBean result)
Decides how to go on depending on the information of the server response.Shows a warning if there is another upload process active (inside the same session).
Otherwise if the list of files to upload contains already existent resources on the VFS or if there are files selected that have invalid file names the overwrite dialog is shown.
Only if there is no other upload process running and none of the selected files is already existent on the VFS the upload is triggered.
- Parameters:
result
- the bean that contains the information to evaluate
-
removeDragAndDropMessage
protected void removeDragAndDropMessage()
Removes the drag and drop message.
-
setContentLength
protected void setContentLength(long contentLength)
Sets the contentLength.- Parameters:
contentLength
- the contentLength to set
-
setContentWrapperHeight
protected void setContentWrapperHeight()
Execute to set the content wrapper height.
-
setDragAndDropMessage
protected void setDragAndDropMessage()
Displays the 'use drag and drop' / 'no drag and drop available' message.
-
setSummaryHTML
protected void setSummaryHTML(java.lang.String html)
Sets the HTML of the selection summary.- Parameters:
html
- the HTML to set as String
-
updateProgress
protected void updateProgress()
Retrieves the progress information from the server.
-
updateProgressBar
protected void updateProgressBar(org.opencms.gwt.shared.CmsUploadProgessInfo info)
Updates the progress bar.- Parameters:
info
- the progress info
-
-