[MGNLDAM-939] JCR DAM has fixed nodetypes for node storing binary data Created: 17/Feb/21  Updated: 20/Jan/22  Resolved: 01/Mar/21

Status: Closed
Project: Magnolia DAM Module
Component/s: DAM App, DAM JCR Provider
Affects Version/s: 3.0.5
Fix Version/s: 3.0.6

Type: Bug Priority: High
Reporter: Richard Gange Assignee: Adam Siska
Resolution: Fixed Votes: 0
Labels: maintenance, metadata
Remaining Estimate: Not Specified
Time Spent: 44m
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2021-02-17 at 16.35.59.png     PNG File Screenshot 2021-02-17 at 16.39.10.png     PNG File image-2021-03-16-11-35-31-048.png    
Issue Links:
Problem/Incident
causes MGNLUI-6990 Not Uploading An Asset To A Custom DA... Closed
Relates
relates to MGNLUI-5656 Improve Upload Field implementation Closed
causality
duplicate
duplicates MGNLDAM-883 JCR Asset content node has incorrect ... Closed
relation
is related to MGNLDAM-667 Fix full text dam search (Assets app) Closed
is related to MGNLPN-616 Persona's item photo node should have... Open
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: Migrate Assets
Sprint: Maintenance 46
Story Points: 5

 Description   

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


 Comments   
Comment by Jan Haderka [ 17/Feb/21 ]

It's still the mgnl:resource for previously uploaded assets (last line of the dump output):

but not anymore for the new ones:

 

 

 

 

Comment by Richard Gange [ 17/Feb/21 ]

Right, those were bootstrapped in. Try and create a brand new asset. Then you will have a mix.

Comment by Adam Siska [ 26/Feb/21 ]

For RN please see https://git.magnolia-cms.com/projects/MODULES/repos/dam/pull-requests/198/overview?commentId=74624

Generated at Mon Feb 12 05:04:47 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.