[MAGNOLIA-1465] adds multiple value handling for properties (NodeData) Created: 16/Apr/07  Updated: 22/Dec/08  Resolved: 18/Sep/08

Status: Closed
Project: Magnolia
Component/s: core, gui
Affects Version/s: 3.1 M1
Fix Version/s: 4.0

Type: Improvement Priority: Major
Reporter: Oliver Lietz Assignee: Teresa Miyar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File Content.java.diff     File ControlImpl.java.diff     File DialogControlImpl.java.diff     File NodeData.java.diff     File NodeDataUtil.java.diff    
Issue Links:
supersession
is superseded by MAGNOLIA-2363 core: multivalue support 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)
Date of First Response:

 Description   

lets you save and get properties with multiple values

To save a property with multiple values you need a custom SaveHandlerImpl (this is java5 for client project):

protected void processMultiple(Content content, String name, int type, String[] strings) throws RepositoryException,
PathNotFoundException, AccessDeniedException {

List<Value> values = new ArrayList<Value>();
NodeData data = NodeDataUtil.getOrCreate(content, name);
if (strings != null && strings.length != 0) {
for (String string : strings) {
Value value = getValue(string, type);
if (value != null)

{ values.add(value); }

}
data.setValue(values.toArray(new Value[values.size()]));
} else

{ data.delete(); }

}

So there should be a switch for multiple nodes and multiple values later in related classes.

XML export looks like so:

<sv:property sv:name="product:colors" sv:type="String">
<sv:value>black</sv:value>
<sv:value>blue</sv:value>
</sv:property>



 Comments   
Comment by Oliver Lietz [ 16/Apr/07 ]

modified gui classes

Comment by Magnolia International [ 16/Sep/08 ]

Thanks Oliver ! We're finally starting to look into this and your patches are of great help

Comment by Teresa Miyar [ 18/Sep/08 ]

implemented for verion 3.7 some documenttion: http://wiki.magnolia.info/display/DEV/Concept+Multi-value

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