Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 229687

Re: vCloud Director metadata entry type?

$
0
0

OK.

 

Could you show your code using instanceof which you said is not working?

 

Another thing to check (a bit stupid, but there is a chance for it to work). As there is only a handful of possible metadata entry types, for each entry you can try to retrieve its value for each possible type. there is a chance that these calls will return null or throw an error if the entry actual type doesn't match the type you pass to it. Something like the following:

 

for each (var metadataEntry in metadataEntries) {      var val = null;    var stringValue = metadataEntry.typedValue.getValue(new VclMetadataStringValue);      if (val == null && stringValue != null) {        val = stringValue;    }    var booleanValue = metadataEntry.typedValue.getValue(new VclMetadataBooleanValue);      if (val == null && booleanValue != null) {        val = booleanValue;    }    var numberValue = metadataEntry.typedValue.getValue(new VclMetadataNumberValue);      if (val == null && numberValue != null) {        val = numberValue;    }    var datetimeValue = metadataEntry.typedValue.getValue(new VclMetadataDateTimeValue);    if (val == null && datetimeValue != null) {        val = datetimeValue;    }    if (val != null) {        System.log("Metadata key: " + metadataEntry.key + " value: " + val.value);    }
}  

Viewing all articles
Browse latest Browse all 229687

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>