Uploaded image for project: 'Magnolia DAM Module'
  1. Magnolia DAM Module
  2. MGNLDAM-939

JCR DAM has fixed nodetypes for node storing binary data

XMLWordPrintable

    • Yes
    • Yes
    • Maintenance 46
    • 5

      It used to be mgnl:resource and now it's mgnl:contentNode.

      See indexing_configuration_dam.xml

      <aggregate primaryType="mgnl:asset">
          <include primaryType="mgnl:resource">*</include>
      </aggregate>
      

      Actual

      <?xml version="1.0" encoding="UTF-8"?>
      <sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" sv:name="untitled">
         <sv:property sv:name="jcr:primaryType" sv:type="Name">
            <sv:value>mgnl:asset</sv:value>
         </sv:property>
         <sv:property sv:name="jcr:uuid" sv:type="String">
            <sv:value>f0efd8c8-d382-4aac-bdeb-84e3e98733f2</sv:value>
         </sv:property>
         <sv:property sv:name="metadataStandard" sv:type="String">
            <sv:value>Simple Dublin Core Metadata Element Set (DCMES)</sv:value>
         </sv:property>
         <sv:property sv:name="mgnl:lastModified" sv:type="Date">
            <sv:value>2021-02-17T14:54:58.431Z</sv:value>
         </sv:property>
         <sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
            <sv:value>superuser</sv:value>
         </sv:property>
         <sv:property sv:name="mgnl:tags" sv:type="String" sv:multiple="true" />
         <sv:node sv:name="jcr:content">
            <sv:property sv:name="jcr:primaryType" sv:type="Name">
               <sv:value>mgnl:contentNode</sv:value>
            </sv:property>
            <sv:property sv:name="jcr:uuid" sv:type="String">
               <sv:value>33176eca-9329-4d57-886f-469e7d685b3e</sv:value>
            </sv:property>
            <sv:property sv:name="extension" sv:type="String">
               <sv:value>jpg</sv:value>
            </sv:property>
            <sv:property sv:name="fileName" sv:type="String">
               <sv:value>6376.jpg</sv:value>
            </sv:property>
            <sv:property sv:name="height" sv:type="Long">
               <sv:value>510</sv:value>
      

      Workaround
      In 6.2.5
      Hotfix /dam-app-jcr/decorations/dam-assets-app/apps/dam.subApps.yaml
      On line 358 add: nodeType: mgnl:resource

      jcrDetail:
        class: info.magnolia.ui.contentapp.detail.DetailDescriptor
        datasource: *datasource
        itemProvider:
          $type: jcrNodeFromLocationProvider
          nodeType: mgnl:asset
        actions:
          commit:
            class: info.magnolia.dam.app.action.JcrAssetCommitActionDefinition
          cancel:
            $type: closeAction
        form:
          properties:
            upload:
              factoryClass: info.magnolia.dam.app.field.factory.DamUploadFieldFactory
              class: info.magnolia.ui.editor.UploadViewDefinition
              required: true
              itemProvider:
                $type: jcrChildNodeProvider
                nodeName: jcr:content
                nodeType: mgnl:resource
      

      Be sure to fix the metadata of any asset that was created with the incorrect nodeType.

      Dev Notes

      • Add a line to the dam configuration: nodeType: mgnl:resource
      • Add a update task to fix the node types of any asset using mgnl:contentNode

        Acceptance criteria

              asiska Adam Siska
              rgange Richard Gange
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 44m
                    44m