[MGNLREST-47] Enable setting/getting of binary properties Created: 10/Jan/14  Updated: 12/Apr/21  Resolved: 14/Jan/14

Status: Closed
Project: Magnolia REST Framework
Component/s: services
Affects Version/s: 1.0.1
Fix Version/s: 1.0.2

Type: Bug Priority: Critical
Reporter: Tobias Mattsson Assignee: Philip Mundt
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File asset.json     File asset_jcrContent.json     File test.json    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Release notes required:
Yes
Date of First Response:

 Description   

Reading out a DAM asset to a file, stripping out the jcr:uuid, jcr:primaryType properties and then doing a POST will not update the binary property.

The problem is in PropertyUtil.createValue() where conversion of the submitted String to a Binary Value object should be done but isn't.

Getting/setting binary properties should always occur base64 encoded.



 Comments   
Comment by Philip Mundt [ 10/Jan/14 ]

If binary data is sent via json/xml it has to be base64 encoded.

Comment by Philip Mundt [ 10/Jan/14 ]

Json-test-file to post binary data.

Comment by Daniel Lipp [ 13/Jan/14 ]

Missing unit-test. Might be beneficial to change #getValueByType() from private to protected or package protected so it can be tested on it's own...

Comment by Philip Mundt [ 15/Jan/14 ]

Adding two more sample json files. One to create a new asset node and the other one to create the binary data subnode (jcr:content) of this asset.

Comment by Daniel Lipp [ 24/Jan/14 ]

Pls squash nicely before merging to master...

Generated at Mon Feb 12 06:56:03 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.