Has any concensus been reached on whether or not we will allow for nesting of EMD?
store.setValue("Preferences", "abego.yoursearch.lastSearchText", "tiddly");store.setValue("JoeBrown", "ContactManager.street", "Washington St");
store.setValue("JoeBrown", "ContactManager.zip", "12345");
store.setValue("JoeBrown", "ContactManager.phone", "555-1234");
Has any concensus been reached on whether or not we will allow for nesting of EMD?
Nesting is supported through the "dot notation" and the namespaces.
E.g.
store.setValue ("JoeBrown", "ContactManager.street", "Washington St");store.setValue("Preferences", "abego.yoursearch.lastSearchText", "tiddly");
store.setValue("JoeBrown", "ContactManager.zip", "12345");
store.setValue("JoeBrown", " ContactManager.phone", "555-1234");
whats the easiest way to 'run through' or retrieve all ContactManager.* metadata? Eg get the values for all ContactManager metadata for that tiddler in an array. Or check to see if the tiddler has any ContactManager metadata.
if (hasAnyContactManagerData("JoeBrown"))
result += "JoeBrown has ContactManagerData\n";
else
result += "JoeBrown has no ContactManagerData\n";
if (hasAnyContactManagerData("HelloThere"))
result += "HelloThere has ContactManagerData\n";
else
result += "HelloThere has no ContactManagerData\n";
Shouldnt the second line be:
var result= [];
since result is supposed to be an array?
for (var n in result) {
alert("found field %0 with value %1".format([n, result[n]]);
}
function getContactManagerFieldNames(tiddler) {
var result = [];
store.forEachField(tiddler,
function(tiddler, namespacePath, fieldName, value) {
if (namespacePath == "ContactManager") {
result.push(fieldName]);
}
});
return result;
}