Class 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
    • 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 interface com.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>
        Overrides:
        addCloseHandler in class com.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)
        Returns true 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 interface I_CmsUploadDialog
        Parameters:
        results - a JSON Object
      • 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 interface I_CmsUploadDialog
        Parameters:
        message - the message to show
        stacktrace - 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
      • 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,​CmsFileInfogetFilesToUpload()
        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
      • setContentLength

        protected void setContentLength​(long contentLength)
        Sets the contentLength.

        Parameters:
        contentLength - the contentLength to set
      • 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