Open the menu
    ```html

    Multiple File Upload

    To enable multiple file uploads in LumisXP, a specific control was developed.

    This control utilizes various plugins as part of the front-end solution, such as: uploadify version 2.1.4 (http://www.uploadify.com/), Modernizr version 2 (http://modernizr.com/), JQuery File Upload (http://aquantum-demo.appspot.com/file-upload).

    Requirements

    Have LumisXP Java 6.1 or later.

    The Plugin requires the following minimum configuration:

    • JQuery 1.6.2 or later;
    • swfObject 2.2 or later;
    • Flash Player 9.0.24 or later, with the latter being necessary on the client side;

    Operation

    Files are uploaded individually, one request for each file, and are processed concurrently, creating a temporary file for each file added to the uploads list. Note that if the processAction confirmation is not executed, the files will not be associated with the repository, and the temporary files will be deleted by another asynchronous process.

    Only files that are in the list at the moment of confirmation are associated with the repository.

    Other information can be associated with each file or with the group of files.

    For persistence to work correctly, it is necessary to use and properly configure the processAction for multiple additions.

    Limitations

    This control maintains state; however, files that have already been uploaded will only be deleted, as mentioned earlier, by an asynchronous cleanup process. If the interface containing the multiple upload control contains other controls that may trigger renderAction actions, it is up to the solution to manage the synchronization of ongoing uploads and the renderAction actions.

    In the same list for upload, it is not possible to insert files with the same name more than once, even if they are not the same file.

    If there is extra information associated with the file, it can be validated through processActions or by some client-side implementation of the solution. Currently, the control does not perform checks other than verifying ongoing uploads at the moment of attempting to trigger a ProcessAction.

    Control Behavior

    Standard flow:

    • Access the screen that contains the control;
    • Click to add;
    • Select as many files as desired;
    • Click to select;
    • This process can be repeated indefinitely.
    • Enter extra information, if applicable;
    • Click to confirm.

    Detailed process:

    • When selecting a file, it checks whether another file with the same name already exists in the list;
    • If a file with the same name does not exist in the list, a temporary file is created on the server;
    • For each upload, it is validated whether:
      • If the session is open;
      • If the user has permission to view the service instance;
      • If the user has permission to perform upload;
      • If the file respects the maximum file size limit for upload.
    • If not, a message is sent to the user, informing that this file cannot be included and it is removed from the list.

      This process applies to each file inserted in the list.

    • If there is extra information associated with the file to be filled, this information is made available according to each sub-control defined in the multiple upload control (douidefinition.xml);
    • If any of these fields are mandatory, it is the solution's responsibility to perform the validation.
    • If there is no additional information to be filled, by clicking confirm, a processAction developed specifically for the addition of multiple files is called, executing the inclusion of each file and its respective information, creating a file in the file repository.
    • This processAction can be Content (including Lumis metadata) or just Table, without metadata.
    • Temporary files are deleted by an asynchronous process triggered at predetermined time intervals.

    Using the control in an interface

    • A node in the processAction (multiFileUploadControlId) must inform the Id of the MultiFileUpload control; both (processAction and multiple upload control) must be associated with the same repository as the control;
    • If this repository has other fields besides the file, the fields that are visible for the interface that contains the MultiFileUpload control can define sub-controls in the multiple upload control to handle the other fields of the repository for each file;

    Transforming a single addition screen into a multiple addition screen

    lumis.services.general_features.multiple_file_upload_001
    Original Image Addition Screen
    lumis.services.general_features.multiple_file_upload_002
    Multiple File Addition Screen
    lumis.services.general_features.multiple_file_upload_003
    Addition in Progress

    Changes:

    ServiceDefinition:

    New interface added:

    Douidefinition:

    Starting from the original Addition interface, changes:

    • Source:
    • Original addition interface:
    • Multiple addition interface:

    In Adding Multiples

    • Body of the interface:
    • Original addition interface:
    • Multiple addition interface.
    • ProcessActions:
    • Original addition interface:
    • Multiple addition interface:

    Customization of the Multiple Upload Control

    The multiple upload control can be customized in the solutions according to user needs. The images of the buttons (Add, Clear, and Delete) can be customized through nodes in the multiple upload control. Below are the nodes for customizing the buttons:

    In addition to the buttons, the messages can also be customized. Below are the nodes for customizing the Messages:

    As illustrated in the previous sections, it is possible to create sub-controls, which will be rendered for each attached file, through the definition of the "controls" node in the multiple upload control.

    In addition to the customizations mentioned above, it is also possible to customize the stylesheet used by the control; thus, the user only needs to identify which CSS classes are used in each HTML element generated by the control and define new styles for them.

    It is important to emphasize that the sub-controls defined in the multiple upload control do not support content validation. Therefore, all fields of the source used by the sub-controls that are mandatory must be validated through ProcessActions.

    Below is presented the structure of the XML produced by the multiple upload control.

    Below is presented the structure of the XML produced by the multiple upload control.

    Customization of the layout of the multiple upload control

    To customize the layout of the multiple upload, the user can customize one of the templates related below or redefine some class used by the control.

    <xsl:template name="multFileUploadSupportedVersionHTML4Content"/>

    <xsl:template name="multFileUploadSupportedVersionFlashContent"/>

    <xsl:template name="multFileUploadSupportedVersionHTML5Content"/>

    <xsl:template name="multFileUploadTemplateUploadHTML5"/>

    <xsl:template name="multFileUploadTemplateCompleteWithErrorHTML5"/>

    <xsl:template name="multFileUploadTemplateCompleteWithSuccessHTML5"/>

    Below, an example of customizing the layout of the multiple upload control in the image repository is presented.

    Below is presented the structure of the XML produced by the multiple upload control.

    The result of the customization can be seen in the image below.

    lumis.services.general_features.multiple_file_upload_004
    Result of Customization
    ```