[MGNLUI-646] Create Node2MapUtil class to transform node to map and back Created: 14/Feb/13  Updated: 27/Feb/13  Resolved: 18/Feb/13

Status: Closed
Project: Magnolia UI
Component/s: framework
Affects Version/s: None
Fix Version/s: 5.0

Type: Task Priority: Neutral
Reporter: Jozef Chocholacek Assignee: Jozef Chocholacek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Release notes required:
Yes
Date of First Response:

 Description   

In order to store messages (especially of the future WORKITEM type), we need a class to transform Map<String,Object> to JCR Node and the other way around.



 Comments   
Comment by Eric Hechinger [ 18/Feb/13 ]

In the map2node(Node node, Map<String, Object> map) method, during iteration of the key:

It would be better to check if the value is an instance of a Map and then directily perform a recursive call instead of doing this in the catch block .
Something like:
for (String key : map.keySet()) {
if (value instanceof Map && !((Map) value).isEmpty()) {
--> Recursive call
else {
--> normal handling of a property value
PropertyUtil.setProperty(node, key, value);

Generated at Mon Feb 12 08:38:52 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.