[MGNLUI-1376] JCR Multiple property values not supported yet. Created: 16/May/13  Updated: 24/Jun/13  Resolved: 30/May/13

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

Type: Bug Priority: Critical
Reporter: Eric Hechinger Assignee: Eric Hechinger
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
is depended upon by MGNLCAT-52 As a user I can use Categorization li... Closed
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
Date of First Response:
Sprint: Beta 3

 Description   

Currently JCR property defined as multiple is not supported
<sv:property sv:name="excludeChannels" sv:type="String" sv:multiple="true">
<sv:value>desktop</sv:value>
<sv:value>smartphone</sv:value>
</sv:property>

JcrNodeAdapter should be able to:

  • retrieve this value and convert it as a set (Vaadin Property)
  • Item's used in fields (as property datasource) should be able to populate it
  • convert the Vaadin Property to JCR Values.

In addition we should adapt the AbstractFieldBuilder. The following class will never call the getDefaultFieldType(...) as by default in the ConfiguredFieldDefinition the type is set by default to String.

protected Class<?> getFieldType(FieldDefinition fieldDefinition) {
if (StringUtils.isNotBlank(fieldDefinition.getType()))

{ return DefaultPropertyUtil.getFieldTypeClass(fieldDefinition.getType()); }

return getDefaultFieldType(fieldDefinition);
}



 Comments   
Comment by Eric Hechinger [ 16/May/13 ]

In AbstractJcrNodeAdapter.getItemProperty(), Use
value = PropertyUtil.getPropertyValueObject(jcrNode, String.valueOf(id));
--> This will create a Set<Object> in case of JCR multiple property value.

We will have to take care of the conversion back from VaadinProperty to JCR multiple property value.

Comment by Tobias Mattsson [ 29/May/13 ]

Copyright headers should have been changed to 2011-2013 and 2012-2013

OptionGroupFieldBuilder default inits with HashSet, is this intended? Shouldn't it be ArrayList to preserve order?

Comment by Eric Hechinger [ 29/May/13 ]

unfortunately yes, as Vaadin internally handle the multiselect as a Set.
We always could define a convertor (Set to List) but as internally it's handle as a set, I better directly define the property as Set.

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