adds multiple value handling for properties (NodeData)
------------------------------------------------------
Key: MAGNOLIA-1465
URL: http://jira.magnolia.info/browse/MAGNOLIA-1465
Project: Magnolia
Issue Type: Improvement
Components: core, gui
Affects Versions: 3.1
Reporter: Oliver Lietz
Assigned To: Sameer Charles
Attachments: Content.java.diff, NodeData.java.diff,
NodeDataUtil.java.diff
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>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia.info/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------