Repository: oodt Updated Branches: refs/heads/master f286ded40 -> 70e5517b5
OODT-913 Multiple metadata values not written out into product-types.xml Project: http://git-wip-us.apache.org/repos/asf/oodt/repo Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/70e5517b Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/70e5517b Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/70e5517b Branch: refs/heads/master Commit: 70e5517b50bcc02c5c5764ed4b2ef36b00c10448 Parents: f286ded Author: Luca Cinquini <[email protected]> Authored: Mon Nov 2 10:44:47 2015 -0700 Committer: Luca Cinquini <[email protected]> Committed: Mon Nov 2 10:44:47 2015 -0700 ---------------------------------------------------------------------- CHANGES.txt | 2 ++ .../oodt/cas/filemgr/util/XmlStructFactory.java | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oodt/blob/70e5517b/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 33992c6..4178835 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,8 @@ Apache OODT Change Log ====================== Release 0.11 - Current Development +* OODT-913 Multiple metadata values not written out into product-types.xml (luca) + * ODT-862 Include the Workflow ID as part of the standard metadata (luca) * OODT-885 RegEx Precondition Comparator for DRAT --exclude feature (Karanjeet http://git-wip-us.apache.org/repos/asf/oodt/blob/70e5517b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/util/XmlStructFactory.java ---------------------------------------------------------------------- diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/util/XmlStructFactory.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/util/XmlStructFactory.java index dd0a68e..14852ad 100644 --- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/util/XmlStructFactory.java +++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/util/XmlStructFactory.java @@ -399,21 +399,26 @@ public final class XmlStructFactory { // add type metadata Element metElem = document.createElement("metadata"); - for (String key : type.getTypeMetadata().getAllKeys()) { + Metadata typeMetadata = type.getTypeMetadata(); + + // loop over all type metadata keys + for (String key : typeMetadata.getAllKeys()) { Element keyValElem = document.createElement("keyval"); Element keyElem = document.createElement("key"); - Element valElem = document.createElement("val"); - keyElem.appendChild(document.createTextNode(key)); - valElem.appendChild(document.createTextNode( - type.getTypeMetadata().getMetadata(key))); keyValElem.appendChild(keyElem); - keyValElem.appendChild(valElem); + + // loop over all metadata values for that key + for (String value : typeMetadata.getAllMetadata(key)) { + Element valElem = document.createElement("val"); + valElem.appendChild(document.createTextNode(value)); + keyValElem.appendChild(valElem); + } metElem.appendChild(keyValElem); } + typeElem.appendChild(metElem); - root.appendChild(typeElem); }
