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

DublinCore metadata cannot be retrieved from an asset

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 2.2.3
    • 2.1
    • None
    • Yes
    • Saigon 87, Saigon 88
    • 5

    Description

      DamTemplatingFunctions.getAssetMap(asset) returns keys for the DC metadata but all of the values which should come from the asset are blank.

      To Reproduce - try the following Freemarker in a template:

      [#assign assetMap = damfn.getAssetMap(asset).metadata.dc]
      [#list assetMap?keys as prop]
          ${prop} = ${assetMap[prop]}<br>
      [/#list]
      

      This is because the asset app editor stores all the dc values in properties with no dc prefix, for example
      publisher
      source

      But in the JcrDublinCore class, the property names are named differently, they have a "dc_" prefix, for example:
      dc_publisher
      dc_source

      This is a bug introduced in DAM 2 in the JcrDublinCore class.

      In DAM 1.2.x the constants do not have the dc_ prefix.
      See: https://git.magnolia-cms.com/gitweb/?p=modules/dam.git;a=blob;f=src/main/java/info/magnolia/dam/providers/jcr/JcrDublinCoreAssetMetadata.java;h=102c44367d43a9192fc27ca2d20af00586c59f16;hb=refs/heads/magnolia-module-dam-1.2.x

      And tests also demonstrate that the properties should not have the prefix:
      https://git.magnolia-cms.com/gitweb/?p=modules/dam.git;a=blob;f=src/test/resources/damAssetAndMetadataNodeTree.properties;h=33bacad85424e8e43550052b341f9778af8ba21d;hb=refs/heads/magnolia-module-dam-1.2.x

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                hieu.nguyen Hieu Nguyen Duc
                czimmermann Christopher Zimmermann
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - 2d Original Estimate - 2d
                      2d
                      Remaining:
                      Remaining Estimate - 0d
                      0d
                      Logged:
                      Time Spent - 4d 0.5h
                      4d 0.5h