Uploaded image for project: 'Nuxeo Web UI'
  1. Nuxeo Web UI
  2. WEBUI-1224

Expose value-key on nuxeo-document-attachments

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.26, 3.1.3
    • Component/s: Upload
    • Release Notes Summary:
      The nuxeo-document-attachments element works correctly with multivalued properties configured in Nuxeo Studio
    • Backlog priority:
      800
    • Sprint:
      UI - 2023-8
    • Story Points:
      3

      Description

      This is required to fix the upload to multivalued Blob properties whose XSD definition does not follow the one of "files:files"

      Example of files:files

      • the XSD definition is
          <xs:element name="files" type="nxs:files" />
        
          <xs:complexType name="files">
            <xs:sequence>
              <xs:element name="item" type="nxs:file" minOccurs="0"
                maxOccurs="unbounded" />
            </xs:sequence>
          </xs:complexType>
        
          <xs:complexType name="file">
            <xs:sequence>
              <xs:element name="file" type="nxs:content" />
            </xs:sequence>
          </xs:complexType>
        
      • The JSON payload is
          "properties": {
            "files:files": [
              {
                "file": {
                  "upload-batch": "batchId-1f58f604-f180-45ee-a8ba-1342e51c204d",
                  "upload-fileId": "0"
                }
              }
            ]
          }
        

      Example of a multi Blob property defined in Studio

      • the XSD definition is
          <xs:complexType name="blobList">
            <xs:sequence> 
              <xs:element name="item" type="nxs:content" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence> 
          </xs:complexType>  
          
          <xs:element name="attachments" type="nxs:blobList"/>
        
      • The JSON payload should be
         "properties": {
            "file_schema:attachments": [
                {
                  "upload-batch": "batchId-1f58f604-f180-45ee-a8ba-1342e51c204d",
                  "upload-fileId": "0"
                }
            ]
          }
        

      Because WebUI cannot inspect any property to know which type of definition is used, the easiest solution is to expose a new property for nuxeo-document-attachments to set "value-key" at https://github.com/nuxeo/nuxeo-web-ui/blob/maintenance-3.0.x/elements/nuxeo-document-attachments/nuxeo-document-attachments.js#L78

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 week, 5 hours
                  1w 5h
                  Remaining:
                  Time Spent - 1 day, 3 hours, 2 minutes Remaining Estimate - 4 days, 1 hour, 58 minutes
                  4d 1h 58m
                  Logged:
                  Time Spent - 1 day, 3 hours, 2 minutes Remaining Estimate - 4 days, 1 hour, 58 minutes
                  1d 3h 2m