concept for future magnolia (possibly 3.5) (MAGNOLIA-587)

[MAGNOLIA-812] Easy Configuration Created: 13/Apr/06  Updated: 08/Jun/09  Resolved: 08/Jun/09

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

Type: Sub-task Priority: Major
Reporter: Philipp Bärfuss Assignee: Philipp Bärfuss
Resolution: Outdated Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Date of First Response:

 Description   

Problem:
-----------
A lot of beans are configured by properties stored in a node and the code is therfore full of such statements

String value = node.getNodeData('myProperty').getString();
bean.setMyProperts(value);
...

In the dialogs/controls for example a generic setConfigValue() method is used everywhere and nobody knows which kind of properties a control realy has. In the future the controls must define there properties (using getter and setter).

Solution:
-----------
We shouldn't implement a new persistence framework for JCR (other will do that better), but we need an easy to use Util:

  • BeanUtils.setProperties(bean, node)
  • could handle Maps and Collections too

Hint: Some of the beans will be configured by Spring. We must think about keeping the configuration in the config repository using some custom BeanDefinition registration. A primar start could be:

http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/beans/factory/support/DefaultListableBeanFactory.html



 Comments   
Comment by Magnolia International [ 08/Jun/09 ]

This has been implemented a while ago, as content2bean.

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