Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-17997

Fix file management on binary metadata write error

    XMLWordPrintable

    Details

      Description

      Using a 7.4-SNAPSHOT from sept 24:

      • Setup the following XML contribution with Studio:
       <extension target="org.nuxeo.binary.metadata"
                  point="metadataMappings">
         <!-- Define "processor" to use and specify the attached binary's xpath ("blobXPath") -->
         <!-- Technical "id" should be unique  -->
         <!-- "ignorePrefix" is by default set to true. Here metadata have prefixes, so set it to false. -->
         <metadataMapping id="Example" processor="exifTool" blobXPath="file:content" ignorePrefix="false">
           <!-- "name" = binary metadata  , "xpath" = document metadata -->
           <!-- See PDF metadata extraction example in this page -->
           <metadata name="PDF:PDFVersion" xpath="dc:title"/>
           <metadata name="PDF:Linearized" xpath="dc:description"/>
           <metadata name="File:MIMEType" xpath="dc:source"/>
           <metadata name="File:FilePermissions" xpath="dc:rights"/>
         </metadataMapping>
      </extension>
      
      <!-- Define which mappings will be called by the listener, and under which conditions -->
      <extension target="org.nuxeo.binary.metadata"
                  point="metadataRules">
        <!-- "order" = priority , "async" = listener mode (set "true" to apply mapping as background work) -->
        <!-- Technical "id" should be unique  -->
        <rule id="default" order="0" enabled="true" async="false">
           <metadataMappings>
             <metadataMapping-id>Example</metadataMapping-id>
      
           </metadataMappings>
           <!-- see the link below for filter contributions -->
           <filters>
             <filter-id>hasFileType</filter-id>
      
           </filters>
         </rule>
       </extension>
       
       <extension target="org.nuxeo.ecm.platform.actions.ActionService"
                  point="filters">
         <filter id="hasFileType">
           <rule grant="true">
             <type>File</type>
           </rule>
         </filter>
       </extension>
      

      Import a PDF file into the Platform.
      => Import works correctly

      Update the document's title and / or dc:rights with "some text"
      => An error is triggered by exiftool
      => The reason for it this error is obvious, you can't just write the PDF version or the file rights from this metadata

      => When you go back to the document, the file is not stored in the document anymore
      => Attachments shouldn't disappear because of an exiftool error, the file update process should be transactional

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bchauvin Bertrand Chauvin
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: