Class DocUploadHandler

    • Field Detail

      • originalType

        protected java.lang.Class originalType
      • showOptions

        protected boolean showOptions
      • isTypeAutoSelect

        protected boolean isTypeAutoSelect
      • typeSet

        protected java.util.Set<java.lang.Class> typeSet
      • isModal

        protected boolean isModal
      • filename

        protected java.lang.String[] filename
      • description

        protected java.lang.String description
      • descriptionML

        protected java.util.HashMap<java.lang.String,​java.lang.String> descriptionML
      • opUpload

        protected boolean opUpload
    • Constructor Detail

      • DocUploadHandler

        public DocUploadHandler()
    • Method Detail

      • isTypeAutoSelect

        public boolean isTypeAutoSelect()
      • internalInit

        public void internalInit()
      • getTypeSet

        public java.util.Set<java.lang.Class> getTypeSet()
      • handleUploadError

        public java.lang.String handleUploadError​(java.util.Map<java.lang.String,​java.lang.String> failedMap)
        Convenient method that returns a list (ul/li) of errors for each files.
        Parameters:
        failedMap - a map of errors returned by handleUpload()
        Returns:
        String error list
      • handleUpload

        public java.util.Map<java.lang.String,​java.lang.String> handleUpload()
        Performs upload of all FileDocuments and create/update FileDocuments. Returns a Map of all FileDocuments with errors
        Returns:
        Map a map of errors
      • handleUpload

        public java.util.Map<java.lang.String,​java.lang.String> handleUpload​(DocUploadInfo dui)
        This method allow the use of this formHandler by a programatic call, not in a jsp:usebean tag. Support only one DocUploadInfo.
        Parameters:
        dui - a DocUploadInfo
        Returns:
        failedMap : not empty if some problem occured
      • performUpdate

        protected void performUpdate​(DocUploadInfo info,
                                     java.util.Map<java.lang.String,​java.lang.String> controllerFailedMap,
                                     java.util.List<LuceneDataSearchEngine.IndexingLatch> indexingLatchList)
        Performs creation of a FileDocument from a given DocUploadInfo. Store errors in the given controllerFailedMap.
        Parameters:
        info - a DocUploadInfo
        controllerFailedMap - a Map of errors.
        indexingLatchList - if specified, will be filled with IndexingLatch object for each document updated
      • performCreate

        protected void performCreate​(DocUploadInfo info,
                                     java.util.Map<java.lang.String,​java.lang.String> controllerFailedMap,
                                     java.util.List<LuceneDataSearchEngine.IndexingLatch> indexingLatchList)
        Performs creation of a FileDocument from a given DocUploadInfo. Store errors in the given controllerFailedMap.
        Parameters:
        info - a DocUploadInfo
        controllerFailedMap - a Map of errors.
        indexingLatchList - if specified, will be filled with IndexingLatch object for each document updated
      • getNextUploadStep

        public java.lang.String getNextUploadStep()
        Returns the JavaScript code to use depending of the upload step. The script may refresh opener, make redrect, fill opener form or close the doc chooser.
        Returns:
        String the JavaScript code to execute
      • getStepCase

        protected com.jalios.jcms.upload.DocUploadHandler.UploadStep getStepCase()
        Returns the upload step depending of multiple paramter steps OpenerForm, OpenerRefresh, Redirect
        Returns:
        int the upload step
      • setModal

        public void setModal​(boolean modal)
      • isInModal

        public boolean isInModal()
      • getAvailableFileDocument

        public FileDocument getAvailableFileDocument()
      • getAvailableFileDocuments

        public FileDocument[] getAvailableFileDocuments()
      • isUpdate

        public boolean isUpdate()
      • isFieldMissing

        protected boolean isFieldMissing​(java.lang.String field)
        Description copied from class: JcmsFormHandler
        Check if the given parameter is present in the query parameters
        Overrides:
        isFieldMissing in class JcmsFormHandler
        Parameters:
        field - the field to be checked
        Returns:
        true if this field is present in the query parameters
      • setFilename

        public void setFilename​(java.lang.String[] v)
      • getAvailableFilename

        public java.lang.String getAvailableFilename()
      • setDescription

        public void setDescription​(java.lang.String[] v)
      • getAvailableDescription

        public java.lang.String getAvailableDescription()
      • getAvailableDescriptionML

        public java.util.HashMap<java.lang.String,​java.lang.String> getAvailableDescriptionML()
      • getAvailableDescription

        public java.lang.String getAvailableDescription​(java.lang.String lang)
      • getAllAvailableDescriptionML

        public java.util.HashMap<java.lang.String,​java.lang.String> getAllAvailableDescriptionML()
      • getAvailableCategorySet

        public java.util.Set<Category> getAvailableCategorySet()
      • setRemoveFile

        public void setRemoveFile​(boolean v)
      • getAvailableRemoveFile

        public boolean getAvailableRemoveFile()
      • setUnlock

        public void setUnlock​(boolean v)
      • setUnzipUploadedFiles

        public void setUnzipUploadedFiles​(boolean unzip)
        Set whether uploaded archives should be unziped and a new document created each time
        Parameters:
        unzip - true to unzip, false to leave document intact
      • getUnzipUploadedFiles

        public boolean getUnzipUploadedFiles()
        Check if archives should be unziped and a new document created each time
        Returns:
        true to unzip, false to leave document intact
      • setType

        public void setType​(java.lang.String type)
      • resolveType

        protected void resolveType​(DocUploadInfo info)
      • getAvailableType

        public java.lang.Class<? extends FileDocument> getAvailableType()
      • setOriginalType

        public void setOriginalType​(java.lang.String type)
      • getAvailableOriginalType

        public java.lang.Class getAvailableOriginalType()
      • setOpenerForm

        public void setOpenerForm​(java.lang.String v)
      • getAvailableOpenerForm

        public java.lang.String getAvailableOpenerForm()
      • setRefresh

        public void setRefresh​(java.lang.String v)
      • getAvailableOpenerRefresh

        public java.lang.String getAvailableOpenerRefresh()
      • setNbElt

        public void setNbElt​(int v)
      • getAvailableNbElt

        public int getAvailableNbElt()
      • setStartElt

        public void setStartElt​(int v)
      • getAvailableStartElt

        public int getAvailableStartElt()
      • setJsFunc

        public void setJsFunc​(java.lang.String v)
      • getAvailableJsFunc

        public java.lang.String getAvailableJsFunc()
      • setInitPstatus

        public void setInitPstatus​(boolean initPstatus)
      • isInitPstatus

        public boolean isInitPstatus()
      • setOpUpload

        public void setOpUpload​(java.lang.String v)
      • isUploading

        public boolean isUploading()
      • setMajorUpdate

        public void setMajorUpdate​(boolean v)
      • isUploadEnabled

        public boolean isUploadEnabled()
      • setUploadEnabled

        public void setUploadEnabled​(boolean uploadEnabled)
      • setShowOptions

        public void setShowOptions​(java.lang.String v)
      • getAvailableShowOptions

        public boolean getAvailableShowOptions()
      • getFieldStatus

        public FieldStatus getFieldStatus​(java.lang.String fieldName)
        Returns the FieldStatus for the given field.
        Overrides:
        getFieldStatus in class EditPublicationHandler
        Parameters:
        fieldName - the name of the field
        Returns:
        the FieldStatus for the given field (never null).
        Since:
        jcms-6.0.1
      • checkWorkspaceChange

        public void checkWorkspaceChange()
        check if the workspace has been explictly changed and reconfigure the handler to be consistent
      • checkMemberClassWorkspaceCompliance

        public void checkMemberClassWorkspaceCompliance()
      • getFirstDocumentClassAuthorized

        public static java.lang.Class<? extends FileDocument> getFirstDocumentClassAuthorized​(Member member,
                                                                                              Workspace workspace,
                                                                                              java.lang.Class<? extends FileDocument> defaultValue)
        Retrieve the first document class authorized for publication by the specified member.
        Parameters:
        member - the member for which to perform the verification
        workspace - the workspace in which to perform the verification
        defaultValue - the default class to return if either member or workspace is null, or if member cannot publish any document class in specified workspace
        Returns:
        a FileDocument type class (or return the value specified in defaultValue parameter if member cannot publish any document class in specified workspace)
        Since:
        jcms-9.0.1
      • processIndexingLatch

        public static void processIndexingLatch​(java.util.List<LuceneDataSearchEngine.IndexingLatch> indexingLatchList,
                                                java.lang.Class<?> docClass)
        Process the IndexingLatch list elements
        Parameters:
        indexingLatchList - the List of LuceneDataSearchEngine.IndexingLatch
        docClass - the class of the document (to manage hibernate transaction)